﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Artem.Google.Net;
using System.Globalization;


public partial class Rubro : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        { 
        }
        DefaultRegionMapShow();
    }
    private void DefaultRegionMapShow()
    {
        //DATOS REGION CLIENTE
        string name = RegionInfo.CurrentRegion.DisplayName;


        //LOCALIZACION EN EL MAPA (DIRECCION A LATLONG)
        GeoRequest request = new GeoRequest(name);
        GeoResponse response = request.GetResponse();
        GeoLocation location = response.Results[0].Geometry.Location;
        double latitude = location.Latitude;
        double longitude = location.Longitude;


        //CREACION MAPA
        GoogleMap1.Latitude = latitude;
        GoogleMap1.Longitude = longitude;
        GoogleMap1.MapType = Artem.Google.UI.MapType.Roadmap;
        GoogleMap1.Zoom = 4;

        //CREACION MAPA
        GoogleMap2.Latitude = latitude;
        GoogleMap2.Longitude = longitude;
        GoogleMap2.MapType = Artem.Google.UI.MapType.Roadmap;
        GoogleMap2.Zoom = 4;

        //CREACION MAPA
        GoogleMap3.Latitude = latitude;
        GoogleMap3.Longitude = longitude;
        GoogleMap3.MapType = Artem.Google.UI.MapType.Roadmap;
        GoogleMap3.Zoom = 4;

        //MARCADOR 
        Artem.Google.UI.Marker marcador = new Artem.Google.UI.Marker();
        Session["region_marker"] = marcador;
        marcador.Position.Latitude = latitude;
        marcador.Position.Longitude = longitude;
        GoogleMap1.Markers.Add(marcador);
        GoogleMap2.Markers.Add(marcador);
        GoogleMap3.Markers.Add(marcador);

    }
}